<!--ISI MULAI-->
<div class="dash">
    <table border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td class="bordertebal2"><table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td id="namapel"> <?php echo $namapelatihan ?> | <?php echo $kode ?>-<?php echo $angkatan ?> <span class="delapan"><?php echo $jumlah ?></span></td>
                    </tr>
                    <tr>
                        <td class="borderkanan">Start: <?php echo $tgl_sesi?></td>
                    </tr>
                </table></td>
        </tr>
    </table>
</div>
<div class="beftabel">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td class="tempatlihat" valign="top">
                <div id="lihat">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class=" bagkiri"><div class="con">Kapasitas</div><div class="cen">16</div>
                            </td>
                        </tr>
                        <tr>
                            <td class=" bagkiri"><div class="con">Quota</div><div class="cen"><?php echo $kuota ?></div>
                            </td>
                        </tr>
                        <tr>
                            <td class=" bagkiri"><div class="con">Biaya</div><div class="cen">Rp <?php echo number_format($harga, 0, ',', '.') ?></div>
                            </td>
                        </tr>
                        <tr>
                            <td class=" bagkiri"><div class="con">Jadwal</div><div class="cen">
                              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <?php 
                                    if(!empty($waktu)){
                                        for($i=0;$i<count($waktu);$i++){
                                            echo '<tr>';
                                            echo '<td>'.$waktu[$i]['hari'].'</td>';
                                            echo '<td>'.$waktu[$i]['jam'].'</td>';
                                            echo '</tr>';
                                        }
                                    }else{
                                        echo 'Belum ditentukan';
                                    }
                                ?>
                              </table>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
            <td valign="top">
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="">&nbsp;</td>
                      <td class="keterangan">Keterangan</td>
                      <td class="heading">Lunas</td>
                      <td class="heading">Kit</td>
                      <td class="heading">Sertifikat</td>
                      <td class="heading">Card</td>
                    </tr>
                    <tr>
                      <td class="name din">Name</td>
                      <td class="name din">Phone</td>
                      <td class="name">&nbsp;</td>
                      <td class="name">&nbsp;</td>
                      <td class="name">&nbsp;</td>
                      <td class="name">&nbsp;</td>
                    </tr>
                    <?php 
                        for($i=0;$i<count($pendaftar);$i++){
                            echo '<tr>';
                            echo '<td class="bf2"><span class="round">'.($i+1).'</span> <a href="'.  base_url().'pendaftaran/daftar_con/display_biaya/'.$pendaftar[$i]['ID'].'/'.$pendaftar[$i]['KODE_PELATIHAN'].'/'.$pendaftar[$i]['ANGKATAN'].'">'.$pendaftar[$i]['NAMA'].'('.$pendaftar[$i]['GOL'].')</a></td>';
                            echo '<td class="bf2">'.$pendaftar[$i]['NO_TELP'].'</td>';
                            
                            //Mengambil data pembayaran
                            $query_bayar = 'SELECT SUM(JUMLAH) as TOTAL FROM pembayaran WHERE ID='.$pendaftar[$i]['ID'].' and KODE_PELATIHAN="'.$kode.'" and ANGKATAN='.$angkatan;
                            $bayar = $this->db->query($query_bayar)->row_array();
                            $total = $bayar['TOTAL'];
                            
                            //Mengambil data pngambilan kartu dari tabel peserta
                            $query_peserta = 'SELECT * FROM peserta WHERE ID='.$pendaftar[$i]['ID'];
                            $data_peserta = $this->db->query($query_peserta)->row_array();
                            $status_kartu = $data_peserta['STATUS_AMBIL_KARTU'];
                            
                            
                            if($pendaftar[$i]['TOTAL_BAYAR']-$total<=0)
                                $lunas = 'V';
                            else
                                $lunas = 'X';
                            
                            if($status_kartu)
                                $kartu='V';
                            else
                                $kartu='X';
                            
                            if($pendaftar[$i]['DAPAT_KIT'])
                                $kit='V';
                            else
                                $kit='X';
                            if($pendaftar[$i]['DAPAT_SERTIFIKAT'])
                                $sertifikat='V';
                            else
                                $sertifikat='X';
                            
                            
                            echo '<td class="bfcenter">'.$lunas.'</td>';
                            echo '<td class="bfcenter">'.$kit.'</td>';
                            echo '<td class="bfcenter">'.$sertifikat.'</td>';
                            echo '<td class="bfcenter">'.$kartu.'</td>';
                            echo '</tr>';
                        }
                    ?>
                </table>
                <div id="rekap"> 
                <div id="rekap4"></div>
              	<div id="rekap3">
                    <div id="rekap2">Rekapitulasi</div>
                    <div id="income">Masuk: <span class="putih">Rp <?php echo number_format($pemasukan, 0, ',', '.') ?></span></div>
                    <div id="piutang">Piutang: <span class="putih">Rp <?php echo number_format($piutang, 0, ',', '.')?></span></div>
                    <div class="clear"></div>
                </div>
                <div id="total">Total: <span class="putih">Rp <?php echo number_format($total_harus_bayar, 0, ',', '.')?></span></div>
                </div>
            </td>
        </tr>
    </table>
</div>

</div>
</td>
<td class="b6"></td>
</tr>
<tr>
    <td class="b4"></td>
    <td class="b5">    <div class="footer2">Copyright &copy;2011 CIC Team | Credits</div></td>
    <td class="b6"></td>
</tr>
<tr>
    <td id="b7"></td>
    <td id="b8"></td>
    <td id="b9"></td>
</tr>
</table>
